#include "mainwindow.h"
#include "ui_mainwindow.h"

void MainWindow::loadAppointMusicDir(const QString & filepath)
{
    QDir dir(filepath);
    if (dir.exists() == false)
    {
        QMessageBox::warning(this, "文件夹", "文件夹打开失败");
        return;
    }

    QFileInfoList filelist = dir.entryInfoList(QDir::Files);

    for (auto element : filelist)
    {
        if (element.suffix() == "mp3")
        {
            ui->musicList->addItem(element.baseName());
        }
    }
}
